import http from './axios'

// 获取七牛token
export const get_qiniu = () => {
    return http({
        url: '/admin_common_qiniu_token',
        method: "get"
    })
}

// 登录
export const login = data => {
    return http({
        url: '/admin_login',
        method: "post",
        data
    })
}

// 获取单位详情
export const unit = params => {
    return http({
        url: '/admin_company_category',
        method: 'get',
        params
    })
}

// 首页统计
export const home = () => {
    return http({
        url: '/admin_asset_statistics',
        method: 'get'
    })
}

// 首页单位管理
export const unit_statistics = () => {
    return http({
        url: '/admin_company_category_statistics',
        method: 'get'
    })
}

// 获取资产
export const get_asset = params => {
    return http({
        url: '/admin_asset_paginate',
        method: 'get',
        params
    })
}

// 获取分类列表
export const get_class = () => {
    return http({
        url: '/admin_category_lists',
        method: 'get'
    })
}

// 新增资产
export const add_asset = data => {
    return http({
        url: '/admin_asset_add',
        method: 'post',
        data
    })
}

// 删除资产
export const del_asset = data => {
    return http({
        url: '/admin_asset_delete',
        method: 'post',
        data
    })
}

// 编辑资产
export const edit_asset = data => {
    return http({
        url: '/admin_asset_edit',
        method: 'post',
        data
    })
}

// 分类列表
export const class_list = () => {
    return http({
        url: '/admin_category_lists',
        method: 'get'
    })
}

// 新增分类
export const add_class = data => {
    return http({
        url: '/admin_category_add',
        method: 'post',
        data
    })
}

// 编辑分类
export const edit_class = data => {
    return http({
        url: '/admin_category_edit',
        method: 'post',
        data
    })
}

// 删除分类
export const del_class = data => {
    return http({
        url: '/admin_category_delete',
        method: 'post',
        data
    })
}

// 单位列表
export const unit_list = params => {
    return http({
        url: '/admin_company_category_paginate',
        method: 'get',
        params
    })
}

// 删除单位
export const del_unit = data => {
    return http({
        url: '/admin_company_category_delete',
        method: 'post',
        data
    })
}

// 新增单位
export const add_unit = data => {
    return http({
        url: '/admin_company_category_add',
        method: 'post',
        data
    })
}

// 编辑单位
export const edit_unit = data => {
    return http({
        url: '/admin_company_category_edit',
        method: 'post',
        data
    })
}

// 子账号列表
export const child_list = params => {
    return http({
        url: '/admin_manages_paginate',
        method: 'get',
        params
    })
}

// 设置用户状态
export const set_status = data => {
    return http({
        url: '/admin_manages_status_edit',
        method: 'post',
        data
    })
}

export const add_manages = data => {
    return http({
        url: '/admin_manages_add',
        method: 'post',
        data
    })
}

export const edit_manages = data => {
    return http({
        url: '/admin_manages_edit',
        method: 'post',
        data
    })
}

export const del_manages = data => {
    return http({
        url: '/admin_manages_delete',
        method: 'post',
        data
    })
}